//
//  CalendarViewController.h
//  FootPrint
//
//  Created by alex tao on 2/25/13.
//  Copyright (c) 2013 alex tao. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "ITTCalendarView.h"
#import "GridScrollView.h"
#import "TimePicker.h"
#import "EventListParser.h"

typedef enum {
    eCalendarView = 0,
    eCalendarSelect
}eCalendarType;


@protocol CalendarPickDelegate <NSObject>

@optional
- (void)calendarDidPickDate:(NSDate*)date;

@end


//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

@interface CalendarViewController : UIViewController <ITTCalendarViewDelegate, ITTCalendarViewDataSource, GridScrollDelegate, EventListDelegate> {
    
    ITTCalendarView *           _calendarView;
    eCalendarType               _calType;
    
    NSDate *                    _selDate;
    NSDateFormatter *           _formatter;
    
    NSDateComponents *          _dateComponent;
    TimePicker *                _timePicker;
    
    EventListParser *           _parser;
}

@property (assign, nonatomic) id<CalendarPickDelegate>      pickDelegate;

@property (retain, nonatomic) IBOutlet GridScrollView *gridScroll;
@property (retain, nonatomic) IBOutlet UIButton *backBtn;
@property (retain, nonatomic) IBOutlet UIButton *okBtn;

@property (retain, nonatomic) IBOutlet ITTCalendarViewFooterView *footerView;
@property (retain, nonatomic) IBOutlet UILabel *timeLabel;

@property (retain, nonatomic) IBOutlet UIView *calendarContainer;
@property (retain, nonatomic) NSArray *     allEventList;


- (IBAction)goBack:(id)sender;
- (IBAction)okSelect:(id)sender;

- (void) calPickModeWithDate:(NSDate*)date update:(BOOL)ifUpdate;
- (void) viewMode:(BOOL)ifUpdate;

- (void) updateCalendarData;

@end
